package hankz.spring.context.event;


import hankz.spring.context.ApplicationListener;

/**
 * @auther zzc
 * @date 2021 11 27
 * <p>
 * 事件广播器
 */
public interface ApplicationEventMulticaster {

    /**
     * Add a listener to be notified of all events
     * <p>
     * 添加监听事件
     *
     * @param listener
     */
    void addApplicationListener(ApplicationListener<?> listener);

    /**
     * 移除所有事件监听
     *
     * @param listener
     */
    void removeApplicationListener(ApplicationListener<?> listener);


    /**
     * Multicast the given application event to appropriate listeners.
     * <p>
     * 事件广播下发  由事件发布者执行
     *
     * @param event
     */
    void multicastEvent(ApplicationEvent event);


}
